package com.whw.springboot.walk.service.servicelmpl;

import com.whw.springboot.walk.entity.LessonApply;
import com.whw.springboot.walk.entity.Message;
import com.whw.springboot.walk.mapper.LessonApplyMapper;
import com.whw.springboot.walk.service.LessonApplyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LessonApplyServiceImpl implements LessonApplyService {

    @Resource
    private LessonApplyMapper lessonApplyMapper;


    @Override
    public Message<?> addLessonApply(LessonApply lessonApply) {
        return lessonApplyMapper.addLessonApply(lessonApply) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message<List<LessonApply>> selectLessonByUserId(String userId) {
        return Message.success(null).add(lessonApplyMapper.selectLessonByUserId(userId));
    }

}
